package cn.stylefeng.guns.modular.customer.entity;

import java.math.BigDecimal;

import cn.stylefeng.guns.modular.course.entity.Course;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 分销记录表
 * </p>
 *
 * @author typ
 * @since 2021-04-25
 */
@TableName("yy_rebate")
@Data
public class Rebate implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 金额
     */
    @TableField("amount")
    private BigDecimal amount;

    @TableField("customer_id")
    private Integer customerId;

    /**
     * 订单id
     */
    @TableField("order_id")
    private Integer orderId;

    /**
     * 购买者id
     */
    @TableField("buyer_id")
    private Integer buyerId;


    @TableField("content")
    private String content;


    @TableField("order_no")
    private String orderNo;

    /**
     * 课程id
     */
    @TableField("course_id")
    private Integer courseId;


    @TableField(exist = false)
    private Customer customer;

    @TableField(exist = false)
    private String level;
    //关联的课程
    @TableField(exist = false)
    private Course course;
    /*
    1 积分 2 返利 3 津贴
     */
    @TableField("state;")
    private Integer state;

    public Rebate(BigDecimal amount, Integer customerId, Integer orderId, Integer buyerId, Integer state) {
        this.amount = amount;
        this.customerId = customerId;
        this.orderId = orderId;
        this.buyerId = buyerId;
        this.state = state;
    }

    public Rebate() {

    }

    @Override
    public String toString() {
        return "Rebate{" +
                "id=" + id +
                ", createTime=" + createTime +
                ", amount=" + amount +
                ", customerId=" + customerId +
                ", orderId=" + orderId +
                ", buyerId=" + buyerId +
                ", state=" + state +
                "}";
    }
}
